import { PoolManager } from 'db://assets/Scripts/Framework/Managers/PoolManager';
import { InGameManager } from '../Managers/InGameManager';
import { Item } from './Item';

export class Module extends Item {

    canUse: boolean = true;
    type: number;
    figure: number;
    maxNum: number = 1;

    static Init(_type: number, _level: number): Module {
        let data = InGameManager.itemsJson.Module[_type][_level];
        let module = PoolManager.GetItem(Module);
        module.num = 1;
        module.type = _type;
        module.itemName = data.name;
        module.figure = data.figure;
        module.sfUrl = data.spriteFrame;
        return module;
    }

}